<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<link rel="stylesheet" href="./CSS/1.京东Tab栏.css">

<body>
    <div id="app">
        <ul>
            <li v-for="(item,index) in dataList" :key=item.id @click="nowIndex=index">
                <a href="#" :class="{active: index === nowIndex}">{{ item.name }}</a>
            </li>
        </ul>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/vue@2.7.14/dist/vue.js"></script>

    <script>
        const app = new Vue({
            el: '#app',
            data: {
                dataList: [
                    { id: 1, name: "京东秒杀" },
                    { id: 2, name: "每日特价" },
                    { id: 3, name: "品类秒杀" }
                ],
                nowIndex: 0
            }
        })
    </script>

</body>

</html>